import { reactive } from "vue";
import type { DialogModel } from '@/type/BaseType';

export default function useDialog() {
    const dialog = reactive<DialogModel>({
        title: '默认标题',
        width: 630,
        height: 280,
        visible: false,
    });


    // 展示
    const onShow = () => {
        dialog.visible = true;
    }


    // 关闭
    const onClose = () => {
        dialog.visible = false;
    }


    // 确认
    const onConfirm = () => {
        dialog.visible = false;


    }

    return {
        dialog,
        onShow,
        onClose,
        onConfirm,
    }


}
















